package cn.harry.wx.entity;

import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.sql.Time;
import java.util.Date;

/**
 * 自动回复规则
 *
 * @author honghh
 * Date 2021-04-08 16:19:27
 * Copyright (C) www.tech-harry.cn
 */
@Data
@TableName("wx_msg_reply_rule")
public class WxMsgReplyRule implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId
    @ApiModelProperty(value = "主键")
    private Long id;

    /**
     * appid
     */
    @ApiModelProperty(value = "appid")
    private String appid;
    /**
     * 规则名称
     */
    @ApiModelProperty(value = "规则名称")
    private String ruleName;
    /**
     * 匹配的关键词、事件等
     */
    @ApiModelProperty(value = "匹配的关键词、事件等")
    private String matchValue;
    /**
     * 是否精确匹配
     */
    @ApiModelProperty(value = "是否精确匹配")
    @TableField(whereStrategy= FieldStrategy.NEVER)
    private boolean exactMatch;
    /**
     * 回复消息类型
     */
    @ApiModelProperty(value = "回复消息类型")
    private String replyType;
    /**
     * 回复消息内容
     */
    @ApiModelProperty(value = "回复消息内容")
    private String replyContent;
    /**
     * 规则是否有效
     */
    @ApiModelProperty(value = "规则是否有效")
    @TableField(value = "`status`",whereStrategy= FieldStrategy.NEVER)
    private boolean status;
    /**
     * 备注说明
     */
    @ApiModelProperty(value = "备注说明")
    @TableField(value = "`desc`")
    private String desc;
    /**
     * 生效起始时间
     */
    @ApiModelProperty(value = "生效起始时间")
    private Time effectTimeStart;
    /**
     * 生效结束时间
     */
    @ApiModelProperty(value = "生效结束时间")
    private Time effectTimeEnd;
    /**
     * 规则优先级
     */
    @ApiModelProperty(value = "规则优先级")
    private Integer priority;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    /**
     * 修改时间
     */
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
    @ApiModelProperty(value = "修改时间")
    private Date modifyTime;
    /**
     * 有效状态：0->无效；1->有效
     */
    @TableLogic
    @ApiModelProperty(value = "有效状态：0->无效；1->有效")
    private Integer valid;
    /**
     * 开始时间
     */
    @JsonIgnore
    @TableField(exist = false)
    private String beginTime;

    /**
     * 结束时间
     */
    @JsonIgnore
    @TableField(exist = false)
    private String endTime;

}
